package main

import "fmt"

type users struct {
	username string
	password string
	age      int
	address  //表示users结构体嵌套 address结构体 匿名
}
type address struct {
	name  string
	phone string
	city  string
}

func main() {
	var u users
	u.username = "张三"
	u.password = "123456"
	u.address.name = "张三"
	u.address.city = "驻马店"
	u.phone = "18569948711" //会在users父结构体中查找 找不到会在字结构体中的查找
	fmt.Printf("%#v\n", u)
	fmt.Println(u.city)
	fmt.Println(u.phone)
	fmt.Println(u.username)

}
